Date: Mon, 16 Dec 1996 22:10:29 GMT
Server: NCSA/1.5
Content-type: text/html
Last-modified: Mon, 26 Feb 1996 14:39:35 GMT
Content-length: 5247


<html>
<head>
<title>
CS418 Lab 7
</title>
</head>

<body>
<h2>  <!WA0><!WA0><!WA0><!WA0><!WA0><!WA0><!WA0><!WA0><img src="http://www.tc.cornell.edu/Visualization/Education/cs418/gifs/teapot.thumb.gif">
CS 418: Laboratory 7</h2> 
<h2> Image Techniques </h2>
<p>
<b> Introduction. </b><p>
In this exercise you will treat images as data to perform
various useful graphics operations including texture-mapping, volume
texture-mapping, and bump-mapping. 

<b><hr>Procedure:</b>
<p>
First you need to download several example files. 
To do this, click on each of the filenames shown
below. When the text window opens, use the "save as" 
option to put the file in your own directory. Name
each file with the same name as shown below. 
<p>
<ul>
<li> <!WA1><!WA1><!WA1><!WA1><!WA1><!WA1><!WA1><!WA1><a href="http://www.tc.cornell.edu/Visualization/Education/cs418/labs/imageRead1994.net"> imageRead.net</a>
<li> <!WA2><!WA2><!WA2><!WA2><!WA2><!WA2><!WA2><!WA2><a href="http://www.tc.cornell.edu/Visualization/Education/cs418/labs/imageRead1994.cfg"> imageRead.cfg</a>
<p>
<li> <!WA3><!WA3><!WA3><!WA3><!WA3><!WA3><!WA3><!WA3><a href="http://www.tc.cornell.edu/Visualization/Education/cs418/labs/Image2Texmap.net"> Image2Texmap.net</a>
<li> <!WA4><!WA4><!WA4><!WA4><!WA4><!WA4><!WA4><!WA4><a href="http://www.tc.cornell.edu/Visualization/Education/cs418/labs/Image2Texmap.cfg"> Image2Texmap.cfg</a>
<p>
<li> <!WA5><!WA5><!WA5><!WA5><!WA5><!WA5><!WA5><!WA5><a href="http://www.tc.cornell.edu/Visualization/Education/cs418/labs/Volume1994.net"> Volume.net</a>
<li> <!WA6><!WA6><!WA6><!WA6><!WA6><!WA6><!WA6><!WA6><a href="http://www.tc.cornell.edu/Visualization/Education/cs418/labs/Volume1994.cfg"> Volume.cfg</a>
<p>
<li> <!WA7><!WA7><!WA7><!WA7><!WA7><!WA7><!WA7><!WA7><a href="http://www.tc.cornell.edu/Visualization/Education/cs418/labs/bumpmap.net"> Bump.net</a>
<li> <!WA8><!WA8><!WA8><!WA8><!WA8><!WA8><!WA8><!WA8><a href="http://www.tc.cornell.edu/Visualization/Education/cs418/labs/bumpmap.cfg"> Bump.cfg</a>
<p>

</ul>

<b> Texture Mapping:</b> The program
imageRead.net
 will show you how to read an image, display it,
and find its size.  Note that an image in DX has a physical size
corresponding to its initial resolution in world units, e.g.  a 100x200
resolution image is 100 by 200 world units in size in the x-y plane with
one corner at the origin.  The reduce module lowers the resolution but does
not change the size of the image, as you can see from the output of the
Statistics modules which are configured to determine the max and min of the
x,y coordinates of the image.  Vary the interactor to change the image
resolution.  An image consists of a 2D field of 3-vectors representing the
red, green, and blue values at each point.  Marking the component "colors"
of an image allows manipulation of the image.  
<p>
The program Image2Texmap.net creats a flag image, then animates it 
as a texture-mapped, parametrically distorted plane.

<p>
<b>Volume Texture Mapping:</b>
A volume texture map (see page 246 of <i>Watt</i>) produces a surface color
on an object which is a function of the 3D 
coordinates of the surface.  The program Volume.net
 gives an example of two volume textures; stripes and
noise (see <!WA9><!WA9><!WA9><!WA9><!WA9><!WA9><!WA9><!WA9><a href="#IM3a">Images 3a+b</a>).  

<p>
<b> Bump Mapping:</b>
Bump-mapping attempts to give a surface more interesting texture by
varying the normals to the surface. The procedure causes the lighting
model to assign different colors to patches of a surface, making it      
appear rougher. Two bump maps are shown below, a random perturbation
of the normals and one that resembles tiles. 
<p>
<!WA10><!WA10><!WA10><!WA10><!WA10><!WA10><!WA10><!WA10><img src="http://www.tc.cornell.edu/Visualization/Education/cs418/labs/labgifs/lab7.bump.random.gif">
<!WA11><!WA11><!WA11><!WA11><!WA11><!WA11><!WA11><!WA11><img src="http://www.tc.cornell.edu/Visualization/Education/cs418/labs/labgifs/lab7.bump.tile.gif">
<p>


<b> <hr> Assignment:</b>
<p>
Construct a scene which includes:
<ul>
<li> A flag of your own design, waving in the wind.
<li> An image from the 
<code>/afs/theory/tc/courses/418/TexMaps</code> directory
as a backdrop.
<li> A hemispherical mirror which reflects an image of the flag.
This is a wide-angle image rendered from a viewpoint behind the flag, then
parametrically deformed into a hemisphere.
</ul>
<p>
The following image is one possibility. A flag is reflected in a mirror
which is placed behind and below the flag. The sky is an image 
which has been parametrically warped into a cylinder.
The image on the right shows a view of the scene zoomed out to show the
"sky".
<p>
<!WA12><!WA12><!WA12><!WA12><!WA12><!WA12><!WA12><!WA12><img src="http://www.tc.cornell.edu/Visualization/Education/cs418/labs/labgifs/lab7.mirror.image.gif">
<!WA13><!WA13><!WA13><!WA13><!WA13><!WA13><!WA13><!WA13><img src="http://www.tc.cornell.edu/Visualization/Education/cs418/labs/labgifs/lab7.mirror.zoom.image.gif">

<hr>
Design functions to produce volume textures simulating:
<ol>
<li> a wood grain of concentric growth rings
<li> marble 
<li> fiberglass  
</ol>
The new textures should be incorporated into the existing 
selector list on the control panel.
In addition, modify the program to map the textures to a sphere and
add an interactor to select between the sphere and the planes.
The volume textures supplied in the program are shown below.

<h4><a name="IM3a">
<!WA14><!WA14><!WA14><!WA14><!WA14><!WA14><!WA14><!WA14><img align=bottom src="http://www.tc.cornell.edu/Visualization/Education/cs418/labs/labgifs/Volume1994.1.gif"> </a>
<a name="IM3b">
<!WA15><!WA15><!WA15><!WA15><!WA15><!WA15><!WA15><!WA15><img align=bottom src="http://www.tc.cornell.edu/Visualization/Education/cs418/labs/labgifs/Volume1994.2.gif"> </a></h4>

<hr>

Starting with the program Bump.net, design bump maps which resemble:
<ul>
<li> Snow covered ground.
<li> A corn field.
<li> Bricks with mortar.
</ul>
<hr>
Be prepared to demo:
<ul>
<li> Your waving flag reflected in a hemispherical lens.
<li> The three volume textures.
<li> The three bump maps.
</ul> 
<p>
<b>You must document your code!</b>  Layout small groups of modules which fit on
one screen and connect them to other groups with transmitters.  You should
use transmitters/receivers, macros, and comments in the "Notation" field of
each module so that you and the grader can understand the program.  Control
panels, if any, should be well organized, labeled, and with the appropriate
numeric ranges.

<p>
<!WA16><!WA16><!WA16><!WA16><!WA16><!WA16><!WA16><!WA16><img src="http://www.tc.cornell.edu/Visualization/Education/cs418/gifs/leftarrow.icon.gif">
Back to <!WA17><!WA17><!WA17><!WA17><!WA17><!WA17><!WA17><!WA17><a href="http://www.tc.cornell.edu/Visualization/Education/cs418/index.html">Main Page</a>
<br>
<!WA18><!WA18><!WA18><!WA18><!WA18><!WA18><!WA18><!WA18><img src="http://www.tc.cornell.edu/Visualization/Education/cs418/gifs/rightarrow.icon.gif">
Go to <!WA19><!WA19><!WA19><!WA19><!WA19><!WA19><!WA19><!WA19><a href="http://www.tc.cornell.edu/Visualization/Education/cs418/lab8.html">Lab 8</a>
 <P>
<hr>
Last modified, 1/18/96, B.Land.
<! Revision history:
	Original document: P.Maxfield, 10/94
>
<br>
<!WA20><!WA20><!WA20><!WA20><!WA20><!WA20><!WA20><!WA20><IMG SRC="http://www.tc.cornell.edu/copyright.xbm">
<!WA21><!WA21><!WA21><!WA21><!WA21><!WA21><!WA21><!WA21><A HREF="http://www.tc.cornell.edu/ctcCopyright.html"> 
<i>Copyright Statement </I></A>
</body> </html>

